Passed
Push — master ( 4c2534...c3984e )
by Christiaan
54s queued 10s
created

getDisplayName.js ➔ ???   A

Complexity

Conditions 1
Paths 5

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 5
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
import { is } from 'ramda'
2
3
/**
4
 * Get the display name for the given component.
5
 * @function
6
 * @param {React.Component} comp - The react component
7
 * @return The display name for the component
8
 */
9
const getDisplayName = comp =>
10
  (is(String, comp) && comp) || comp.displayName || comp.name || 'Component'
11
12
export default getDisplayName
13